package com.itheima.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.annotation.Generated;
import javax.persistence.*;

/**
 * @author Administrator
 * @Data 替代getter setter
 * @NoArgsConstructor 空参构造
 * @AllArgsConstructor 全参构造
 * @Table(name = "user", catalog = "ajax") 标明表和数据库
 * name:表名  catalog:数据库名称
 * @Entity 让ioc容器知道这是一个实体类
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "user", catalog = "ajax")
@Entity
public class User {

    @Id //主键
    @GeneratedValue(strategy = GenerationType.IDENTITY) //自增长
    private Integer id;
    private String name;
    private Integer age;

    @Column(name = "search_count") //数据库对应字段
    private Integer searchCount;

}
